package com.komorebishao.crm.service.impl;

import com.komorebishao.crm.dao.CrmDictMapper;
import com.komorebishao.crm.pojo.CrmDict;
import com.komorebishao.crm.pojo.CrmDictExample;
import com.komorebishao.crm.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: KomorebiShao
 * @Description:
 * @Date: Created in 2020-07-03
 * @Modified By:
 */
@Service
public class DictServiceImpl implements DictService {
    @Autowired
    private CrmDictMapper mapper;
    public List<CrmDict> selectDictByTypeCode(String typeCode) {
        //构造一个条件对象
        CrmDictExample crmDictExample = new CrmDictExample();
        CrmDictExample.Criteria criteria = crmDictExample.createCriteria();
        //加了一个 and typeCode = ?
        criteria.andDictTypeCodeEqualTo(typeCode);
        List<CrmDict> crmDicts = mapper.selectByExample(crmDictExample);
        return crmDicts;
    }
}
